use Test::More;

BEGIN {
	use lib '..';
	
	use_ok('Wix::Harvest');
	use_ok('Wix::Tag::Wix');
	use_ok('Wix::Tag::Package');
	use_ok('Wix::Tag::Feature');
	use_ok('Wix::Tag::Media');
	use_ok('Wix::Tag::UIRef');
	use_ok('Wix::Tag::Property');
}

use strict;

my $wix = Wix::Tag::Wix->new();

my $package = Wix::Tag::Package->new(
	{
		DESCRIPTION => 'Test something'	
	}
);

my $product = Wix::Tag::Product->new(
	{
		NAME => 'Test Project',
		VERSION => '1.0.0.0'
	}
);

$product->addPackage($package);
$product->addMedia(Wix::Tag::Media->new());

my $pfiles = Wix::Tag::Directory::GetProgramFiles();
	
my $target = Wix::Tag::Directory::GetTarget();
	
$target->addDirectory($pfiles);

my $harvest = Wix::Harvest::Harvest("E:\\build\\Copy of GQS GUIs 1.2.0");

$pfiles->addDirectory($harvest->getDirectory());

my $feature = Wix::Tag::Feature->new(
	{
		ID => 'MyFeature',
		TITLE => 'Test Feature',
		LEVEL => 1	
	}
);

$feature->addComponentGroupRef($harvest->getComponentGroup()->getComponentGroupRef());

$product->addDirectory($target);
$product->addComponentGroup($harvest->getComponentGroup());
$product->addFeature($feature);
$product->addUIRef(Wix::Tag::UIRef::GetInstallDir());
$product->addProperty(Wix::Tag::Property::GetInstallDir());

$wix->addProduct($product);

open FILE, ">file.wxs";

print FILE $wix->getSource();

close FILE;

done_testing();